As Ethernet technologies evolve, currently there is a requirement that interface bandwidth and the number of streams can be configured flexibly.
A bandwidth-flexible Ethernet may implement, in the case of total interface bandwidth, flexible configuration of the number of Ethernet frame streams and bandwidth of an Ethernet frame stream. The Ethernet frame stream is also referred to as sub Media Access Control MAC for short) stream. For example, channel resources originally belonging to a fixed 400 gigabit Ethernet (GE for short) interface may be used to bear traffic of one 400 GE, one 300 GE+one 100 GE, two 200 GE, four 100 GE, eight 50 GE, or sixteen 25 GE.
In the prior art, bandwidth of an Ethernet interface of a receiver is fixed. The bandwidth may also be referred to as rate. For example, a rate of a 100 GE interface is 100 gigabit per second, and a rate of a 40 GE interface is 40 gigabit per second. After receiving a data stream, the Ethernet interface of the receiver performs scrambling on the data stream by using a scrambler. The number of bits of a data stream that can be scrambled by a scrambler in each clock cycle is a fixed value. The foregoing technical solutions are difficult to be applied to a scenario of a flexible Ethernet.